import time
def sortirovka(n):
    f=True
    while f:
        f=False
        for i in range(len(n)-1):
            if n[i] > n[i+1]:
                n[i], n[i+1]=n[i+1], n[i]
                f=True
m1=list(map(int,open('m1_sorted.txt').read().splitlines()))
m2=list(map(int,open('m2_reverse.txt').read().splitlines()))
m3=list(map(int,open('m3_shuffle.txt').read().splitlines()))
t0=time.time()
sortirovka(m1)
t=time.time()
print("m1_sorted",round((t-t0)*1000),"milliseconds")
t0=time.time()
sortirovka(m2)
t=time.time()
print("m2_sorted",round((t-t0)*1000),"milliseconds")
t0=time.time()
sortirovka(m3)
t=time.time()
print("m3_sorted",round((t-t0)*1000),"milliseconds")
